package cn.bdqn.or.service;

import cn.bdqn.or.pojo.Product;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

import cn.bdqn.or.dao.ProductMapper;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ProductService {

	@Resource
	private ProductMapper productMapper;


	public int deleteByPrimaryKey(Integer productid) {
		return productMapper.deleteByPrimaryKey(productid);
	}


	public Boolean insert(Product record) {
		return productMapper.insert(record);
	}


	public int updateByPrimaryKey(Product record) {
		return productMapper.updateByPrimaryKey(record);
	}


	public int updateStatusByProductId(String updatedStatus, Integer productId) {
		return productMapper.updateStatusByProductId(updatedStatus, productId);
	}
	@Transactional
	public List<Product> selectByProductName(String productName) {
		return productMapper.selectByProductName(productName);
	}
	public List<Product> selectProduct(){
		return productMapper.selectProduct();
	}
}

